#ifndef E_MOD_MAIN_H_
#define E_MOD_MAIN_H_
#include "module.h"
#define D_(str) dgettext(PACKAGE, str)
#define MODULE_NAME "e17.uptime.module"
#define CONFIG_VERSION 1
#define DEFAULT_THEME "default.edj"
#define DEFAULT_FORMAT "%T"

/*
 ****************************************************************************************************** 
 *		Widget specs 
 * 
 ****************************************************************************************************** 
 */
 
/*
 * Create and initialize new Widget Object
 */
static Widget *_widget_new(E_Module *m, E_Gadcon * gc, const char *name, const char *id, const char *style);
/*
 * Free Widget Object
 */
static void _widget_free(Widget *w);
/*
 * Initialize Widget Theme
 */
static int	_widget_theme_init(Widget *w, Evas *evas);
/*
 * Deinitialize Widget Theme
 */
static void _widget_theme_shutdown(Widget *w);
/*
 * Send Messages from C Widget sources to EDJE Widget Theme
 */
static void _widget_edje_message_send(int id, int message, void *data);

/*
 * CallBack for Mouse Event for Widget 
 */
static void _widget_cb_mouse_down(void *data, Evas * e, Evas_Object * obj,void *event_info);
/*
 * CallBack When You Click on Widget Configure Menu 
 */
static void _widget_menu_cb_configure (void *data, E_Menu * m, E_Menu_Item * mi);
/*
 * CallBack When You post event on Widget Configure Menu 
 */
static void _widget_menu_cb_post (void *data, E_Menu * m);

/*
 ****************************************************************************************************** 
 *		Gadcon specs 
 * 
 ****************************************************************************************************** 
 */

/*
 * Functions that init new Gadcon 
 */
static E_Gadcon_Client *_gc_init (E_Gadcon * gc, const char *name,const char *id, const char *style);
/*
 * Functions that shutdown exested Gadcon 
 */
static void _gc_shutdown (E_Gadcon_Client * gcc);
/*
 * Functions that specify orient of Gadcon 
 */
static void _gc_orient (E_Gadcon_Client * gcc);
/*
 * Functions that returns the name of Client
 */
static char *_gc_label (void);
/*
 * Functions that returns Icon for particular Gadcon
 */
static Evas_Object *_gc_icon (Evas * evas);
/*
 * To Register Gadcon provider we should define Client_Class struct
 */
static const E_Gadcon_Client_Class 
_gc_class = 
{
	GADCON_CLIENT_CLASS_VERSION,
  	MODULE_NAME,
	{_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon},
	E_GADCON_CLIENT_STYLE_PLAIN
};

/*
 ****************************************************************************************************** 
 * Core Specs
 * 
 ****************************************************************************************************** 
 */

/*
 * Create and initialize new Core Object
 * Only one in module
 */
static Core *_core_new(void);
/*
 * Free Core Object
 */
static void _core_free(Core *c);
/*
 * Save Core config
 */
static int _core_config_save(Core *c);
/*
 * Load Core Config
 */
static int _core_config_load(Core *c);
/*
 * CallBack for update timer
 */
static int _core_cb_update(void *data);
/**
 * Brief description of 
 * 
 * Longer comment 
 * Add New Widget object
 */
static Widget *_core_widget_add(Core *c,E_Gadcon * gc, const char *name, const char *id, const char *style);
/*
 * Find config for particular Widget in Config List or create new one
 */
static Widget_Config *_core_widget_config_get(Core *c, const char *id);
/*
 * Delete specified Widget Object
 */
static void _core_widget_delete(Core *c,Widget *w);

/*
 ****************************************************************************************************** 
 * E_MODULE_API Staff 
 * dl directly look into module.so and fill references
 ****************************************************************************************************** 
 */



EAPI extern E_Module_Api e_modapi;
EAPI void *e_modapi_init(E_Module *m);
EAPI int e_modapi_shutdown(E_Module *m);
EAPI int e_modapi_save(E_Module *m);
EAPI int e_modapi_about(E_Module *m);
EAPI int e_modapi_config(E_Module *m);


/*
 ****************************************************************************************************** 
 * configure e17.net.module widget
 * 
 ****************************************************************************************************** 
 */

#define _widget_config(x) _uptime_widget_config(x)
#define _widget_config_updated(x) _uptime_widget_config_updated(x)
#define _core_config(x)	_uptime_core_config(x)
#define _core_config_updated(x) _uptime_core_config_updated(x) 


EAPI E_Config_Dialog *_uptime_widget_config(Widget *w);
void _uptime_widget_config_updated(Widget *w);
EAPI E_Config_Dialog *_uptime_core_config(Core *c);
void _uptime_core_config_updated(Core *c);


#endif /*E_MOD_MAIN_H_*/
